<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{reconciliationBusinessChannelAction}" />
	
	<span class="pagetitle">账务工具 —— 渠道对帐查询</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
        <p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd" />
		-
		<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd" />
        &#160;&#160;&#160;
		
        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
	</h:form>
	<br />

	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel" header="汇总数据" style="margin-bottom:10px;">
	        	 <p:dataTable id="dlist" var="l" value="#{bean.dataList1}" resizableColumns="true" paginator="false" paginatorPosition="top" style="text-align:center;">
					<p:columnGroup type="header">
			            <p:row>
			                <p:column colspan="6" headerText="金额#{pageHelper.getMoneyType()}" />
			                <p:column colspan="6" headerText="外部订单数" />
			            </p:row>
			            <p:row>
			            	<p:column headerText="总计" />
			            	<p:column headerText="astore(1)" />
	                    	<p:column headerText="tstore(2)" />
	                    	<p:column headerText="ntore(3)" />
	                    	<p:column headerText="gtore(4)" />
	                    	<p:column headerText="WEB直充(#{bean.getWebZhiChong()})" />
	                    	<p:column headerText="总计" />
			            	<p:column headerText="astore(1)" />
	                    	<p:column headerText="tstore(2)" />
	                    	<p:column headerText="ntore(3)" />
	                    	<p:column headerText="gtore(4)" />
	                    	<p:column headerText="WEB直充(#{bean.getWebZhiChong()})" />
			            </p:row>
			        </p:columnGroup>
					
				 	<p:column>
			            <h:outputText value="#{l.addcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.astoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.tstoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.nstoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.gstoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.webAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.odernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.astoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.tstoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.nstoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.gstoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.webOdernum}" />
			        </p:column>
				</p:dataTable>
			</p:panel>
		
			<p:panel id="panel1" header="详细数据" style="margin-bottom:10px;">
	        	 <p:dataTable id="dlist1" var="l" value="#{bean.dataList2}" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<f:facet name="{Exporters}">
						<h:commandLink styleClass="exporter">
					        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
					        <p:dataExporter type="xls" target="dlist1" fileName="reconciliation-#{pageHelper.getNewDateDetailStr()}"/>
					    </h:commandLink>
					</f:facet>
					
					<p:columnGroup type="header">
			            <p:row>
			                <p:column rowspan="2" headerText="时间" style="width:70px;"/>
			                <p:column colspan="6" headerText="金额#{pageHelper.getMoneyType()}" />
			                <p:column colspan="6" headerText="外部订单数" />
			            </p:row>
			            <p:row>
			            	<p:column headerText="总计" />
			            	<p:column headerText="astore(1)" />
	                    	<p:column headerText="tstore(2)" />
	                    	<p:column headerText="ntore(3)" />
	                    	<p:column headerText="gtore(4)" />
	                    	<p:column headerText="WEB直充(#{bean.getWebZhiChong()})" />
	                    	<p:column headerText="总计" />
	                    	<p:column headerText="astore(1)" />
	                    	<p:column headerText="tstore(2)" />
	                    	<p:column headerText="ntore(3)" />
	                    	<p:column headerText="gtore(4)" />
	                    	<p:column headerText="WEB直充(#{bean.getWebZhiChong()})" />
			            </p:row>
			        </p:columnGroup>
					
					<p:column>
			            <h:outputText value="#{l.day}" />
			        </p:column>
					<p:column>
			            <h:outputText value="#{l.addcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.astoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.tstoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.nstoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.gstoreAddcash}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.webAddcash}" />
			        </p:column>
					<p:column>
			            <h:outputText value="#{l.odernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.astoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.tstoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.nstoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.gstoreOdernum}" />
			        </p:column>
			        <p:column>
			            <h:outputText value="#{l.webOdernum}" />
			        </p:column>
				</p:dataTable>
			</p:panel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>